from flask_sqlalchemy import SQLAlchemy
from datetime import datetime

# MySQL配置
MYSQL_CONFIG = {
    'host': 'localhost',
    'user': 'root',
    'password': '123456',
    'database': 'garbage_db',
    'auth_plugin': 'mysql_native_password'  # 使用原生密码认证
}

# SQLAlchemy配置
SQLALCHEMY_DATABASE_URI = f"mysql+pymysql://{MYSQL_CONFIG['user']}:{MYSQL_CONFIG['password']}@{MYSQL_CONFIG['host']}/{MYSQL_CONFIG['database']}?charset=utf8mb4"
SQLALCHEMY_TRACK_MODIFICATIONS = False

# 初始化SQLAlchemy
db = SQLAlchemy()